From 955d54ab99fcf402d7f810bd19a34ae59626fc0e Mon Sep 17 00:00:00 2001
Date: Tue, 19 Jan 2021 11:40:23 +0800
Subject: [PATCH] tabview patch

---
 tabbed.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/tabbed.c b/tabbed.c
index eafe28a..7e9e5ca 100644
--- a/tabbed.c
+++ b/tabbed.c
@@ -48,7 +48,7 @@
 #define TEXTW(x)                (textnw(x, strlen(x)) + dc.font.height)
 
 enum { ColFG, ColBG, ColLast };       /* color */
-enum { WMProtocols, WMDelete, WMName, WMState, WMFullscreen,
+enum { tabid,WMProtocols, WMDelete, WMName, WMState, WMFullscreen,
        XEmbed, WMSelectTab, WMLast }; /* default atoms */
 
 typedef union {
@@ -134,6 +134,7 @@ static void unmapnotify(const XEvent *e);
 static void updatenumlockmask(void);
 static void updatetitle(int c);
 static int xerror(Display *dpy, XErrorEvent *ee);
+static void out();
 static void xsettitle(Window w, const char *str);
 
 /* variables */
@@ -482,6 +483,7 @@ focus(int c)
 		XFree(wmh);
 	}
 
+	out();
 	drawbar();
 	XSync(dpy, False);
 }
@@ -992,6 +994,7 @@ setup(void)
 	                                   False);
 	wmatom[WMName] = XInternAtom(dpy, "_NET_WM_NAME", False);
 	wmatom[WMProtocols] = XInternAtom(dpy, "WM_PROTOCOLS", False);
+	wmatom[tabid] = XInternAtom(dpy, "_TABID", False);
 	wmatom[WMSelectTab] = XInternAtom(dpy, "_TABBED_SELECT_TAB", False);
 	wmatom[WMState] = XInternAtom(dpy, "_NET_WM_STATE", False);
 	wmatom[XEmbed] = XInternAtom(dpy, "_XEMBED", False);
@@ -1374,3 +1377,10 @@ main(int argc, char *argv[])
 
 	return EXIT_SUCCESS;
 }
+
+void out(){
+	char tab[256];
+	snprintf(tab, sizeof(tab), "0x%lx",clients[sel]->win);
+	XChangeProperty(dpy, win,wmatom[tabid], XA_STRING, 8, PropModeReplace,(unsigned char *)tab,strlen(tab)+1);
+	XSync(dpy, False);
+}
-- 
GitLab


